/* The contents under 'path' are stored in pMessageBuffer. */
void PrintDir(char *path)
{
	DIR *dp;
	struct dirent *dirp;
	char str[255];
	int i;

	if((dp=opendir(path)) == NULL)
	{
		fprintf(stderr, "Bad Path to Print Dir.\a\n");
		return;
	}

	pMessageBuffer[0] = '\0';

	i = 0;
	while((dirp=readdir(dp)) != NULL)
	{
		i++;
		sprintf(str, "%-20s", dirp->d_name);
		
		if(i % 4 == 0)
		{
			strcat(str,"\n");
			i = 0;
		}
		
		strcat(pMessageBuffer, str);
	}

	closedir(dp);
}
